package com.le.tester.dao;

import com.le.tester.dto.UserRegisterDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * createTime：2024-11-28 15:37
 * description：用户信息dao
 */
@Mapper
public interface UserInfoDao {

    @Insert("insert into user_info (phone,name) values(#{userRegisterDto.phone},#{userRegisterDto.name})")
    int register(@Param("userRegisterDto") UserRegisterDto userRegisterDto);

    @Select("select count(id) from user_info where phone = #{phone}")
    int selectPhone(@Param("phone") String phone);

    @Select("select count(id) from user_info where name = #{name}")
    int selectName(@Param("name") String name);
}
